﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace ApiServer.Filters
{
    public class ExceptionFilter : IExceptionFilter
    {
        public void OnException(ExceptionContext context)
        {
            var log=NLog.LogManager.GetCurrentClassLogger();
            log.Error("捕获到错误：" +context.Exception.Message);
            context.ExceptionHandled = true;//把异常标记为已处理
            //throw new NotImplementedException();
        }
    }
}
